package com.boxuegu.caihuaxuan24.myapplication.activity;

import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import com.boxuegu.caihuaxuan24.myapplication.R;

public class VideoActivity extends AppCompatActivity {
    VideoView videoView;
    String videourl;
    @Override
    protected void onCreate(Bundle savaInstanceState){
        super.onCreate(savaInstanceState);
        setContentView(R.layout.activity_video);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        videoView =findViewById(R.id.videoview);
        if (getIntent()!=null&&getIntent().getStringExtra("videourl")!=null){
            videourl=getIntent().getStringExtra("videourl");

        }
        MediaController mediaController=new MediaController(this);
        videoView.setMediaController(mediaController);
        videoView.setVideoURI(Uri.parse(videourl));
        videoView.start();
    }
}
